package com.example.synchost5.exception;

import lombok.Getter;
import lombok.Setter;

import java.util.HashMap;
import java.util.Map;

public abstract class GlobalException extends RuntimeException {

    @Getter
    @Setter
    private Map<String, Object> errorMap = new HashMap<>();

    public GlobalException(Map<String, Object> errorMap) {
        this.errorMap = errorMap;
    }

    public GlobalException(String message) {
        super(message);
        errorMap.put("message", message);
    }
}
